<template>
    <el-dialog :title="title" :visible.sync="visible" :width="width" :before-close="handleClose">
        <el-row :gutter="10">
            <el-col :span="24">
            </el-col>
            <el-col :span="24">
                <el-tag
                    v-for="tag in tags"
                    :key="tag.id"
                    :type="tag.type"
                >{{ tag.name }}</el-tag>
            </el-col>
            <el-col :span="24">
            </el-col>
        </el-row>
        <span slot="footer" class="dialog-footer">
            <el-button @click="handleClose">取 消</el-button>
            <el-button type="primary" @click="handleClose">确定</el-button>
        </span>
    </el-dialog>
</template>


<script>
	import Panle from '@/components/Panle.vue'
    import PersButton from '@/components/PersButton'
    import SelectImg from "@/components/select-img.vue"
    import {getAssistant, getTagList} from "@/api/scrm/client/clientList";
    import {dateFormat} from "@/utils";
    export default {
        name: 'siftTags',
        props: {
            visible: {
                type: Boolean,
                default: false
            },
            title: {
                type: String,
                default: ''
            },
            width: {
                type: String,
                default: '30%'
            },
            append_to_body: {
                type: Boolean,
                default: false
            },
            tags: {
                type: Array,
                default: []
            }
        },
        components: {
            PersButton,
            SelectImg,
			Panle,
        },
        data() {
            return {
                form: {
                    title: "",
                    checked: false,
                    content: "",
                    checkList: []
                },
                form_client: {
                    add_date: [dateFormat(new Date(), 'yyyy-MM-dd') + ' 00:00:00', dateFormat(new Date(), 'yyyy-MM-dd') + ' 23:59:59'],
                    checked: false,
                    content: "",
                    checkList: []
                },
                loading: false,
                total_num: 0,
                isDisabled: false,
                selectedValue:[],
                assistantData: [],
                tabOptions: [
                    {
                        value: '1',
                        label: '包含企业标签',
                        children: [
                            {
                                value: '11',
                                label: '满足其一'
                            },
                            {
                                value: '12',
                                label: '同时满足'
                            }
                        ]

                    },
                    {
                        value: '2',
                        label: '不包含企业标签',
                    },
                    {
                        value: '13',
                        label: '无标签'
                    }
                ],
                client: {
                    list: []
                }
            }
        },
        created() {
            // 或者通过$route获取参数
            // console.log(this.$route.query.liveId)
            this.init()

        },

        methods: {
            // 关闭弹窗
            handleClose() {
                this.$emit('close');
                this.verifyInput = null;
            },
            // 初始化
            init() {
                this.loading = true
                getTagList().then(res => {
                    this.assistantData = res.data.userlist;
                });
            },
            // 标签变化
            handleChange(value) {
                this.form.qwtype = value[value.length-1];
                if (this.form.qwtype == 13) {
                    this.isDisabled = false;
                }else {
                    this.isDisabled = true;
                }
            },
            //选择标签
            chose_biaoqian() {
                console.log(1221212);
            },
			submitForm:function(data){
			    this.$refs[data].validate((valid) => {
					console.log(999);
					console.log(valid);
					console.log(data);
					console.log(this.form);
					this.open=false;
			    })
			
			},

        }

    }
</script>

<style lang="scss" scoped>
    @import "@/assets/css/common";
</style>